<?php
/**
 * App for managing companies
 * 
 * Template for company detail page
 * 
 * @category Abovo
 * 
 * @package Abovo_App_Crm
 * 
 * @subpackage Abovo_App_Crm_Companies
 * 
 * @license http://opensource.org/licenses/gpl-license.php GPL
 * 
 * @author Antti Holvikari <anttih@gmail.com>
 */
?>
<h2><?php echo $this->escape($this->company->name) ?></h2>

<ul class="actions">
    <li class="first"><?php echo $this->action('buy/suppliers/edit/' . $this->company->id, $this->getText('ACTION_EDIT')) ?></li>
</ul>

<?php $helper = $this->newHelper('GetText');
$helper->setClass('Abovo_Model_Company');
?>
<table class="list">
    <tr>
        <th><?php echo $helper->getText('LABEL_NAME') ?></th>
        <td><b><?php echo $this->escape($this->company->name) ?></b></td>
    </tr>
    <tr>
        <th><?php echo $helper->getText('LABEL_SHORT') ?></th>
        <td><?php echo $this->escape($this->company->short) ?></td>
    </tr>
    <tr>
        <th><?php echo $helper->getText('LABEL_VAT') ?></th>
        <td><?php echo $this->escape($this->company->vat) ?></td>
    </tr>
    <tr>
        <th><?php echo $helper->getText('LABEL_URL') ?></th>
        <td><a href="<?php echo $this->company->url ?>"><?php echo $this->company->url ?></a></td>
    </tr>
    <tr>
        <th><?php echo $helper->getText('LABEL_ADR') ?></th>
        <td>
            <?php echo $this->escape($this->company->adr) ?><br />
            <?php echo $this->escape($this->company->postal_code . ' '. $this->company->city) ?><br />
            <?php echo $this->getTextClass('Lux_Intl', "COUNTRY_{$this->company->country}") ?>
        </td>
    </tr>
    <tr>
        <th><?php echo $helper->getText('LABEL_SHIP_ADR') ?></th>
        <td>
            <?php echo $this->escape($this->company->ship_adr) ?><br />
            <?php echo $this->company->ship_postal_code ?> <?php echo $this->escape($this->company->ship_city) ?><br />
            <?php echo $this->getTextClass('Lux_Intl', "COUNTRY_{$this->company->ship_country}") ?>
        </td>
    </tr>
    <tr>
        <th><?php echo $this->getText('LABEL_CREATED') ?></th>
        <td><?php echo $this->timestamp($this->company->created, $this->getText('FORMAT_TIMESTAMP')) ?></td>
    </tr>
    <tr>
        <th><?php echo $this->getText('LABEL_UPDATED') ?></th>
        <td><?php echo $this->timestamp($this->company->updated, $this->getText('FORMAT_TIMESTAMP')) ?></td>
    </tr>
    <tr>
        <th><?php echo $this->getText('TEXT_TAGS', 2) ?></th>
        <td><span class="tag"><?php echo implode('</span>, <span class="tag">', (array) $this->company->tags) ?></span></td>
    </tr>
    <tr>
        <th><?php echo $helper->getText('LABEL_DESCR') ?></th>
        <td><?php echo wordwrap($this->escape($this->company->descr), 75, '<br />') ?></td>
    </tr>
</table>
<?php unset($helper) ?>